"""travelplus URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.contrib.auth.views import LoginView

from django.urls import path
from accounts.views import admin, account, login, culture, user
from tourist_spot.views import spot, article, picture
from travelplus import settings
from django.conf.urls.static import static


urlpatterns = [
    # path('views/', admin.site.urls),

    # 管理员路由
    # path('admin/dashboard/', admin.dashboard, name='admin_dashboard'),
    # path('admin/users/', admin.user_list, name='user_list'),
    # path('admin/users/<int:user_id>/edit/', admin.edit_user, name='edit_user'),
    # path('admin/cultures/', admin.culture_list, name='culture_list'),
    # path('admin/cultures/<int:culture_id>/edit/', admin.edit_culture, name='edit_culture'),
    # path('admin/spots/review/', admin.spot_review_list, name='spot_review_list'),
    # path('admin/spots/<int:spot_id>/review/', admin.review_spot, name='review_spot'),

    # 文旅机构路由
    # path('culture/dashboard/', culture.dashboard, name='culture_dashboard'),
    # path('culture/spots/', culture.spot_list, name='spot_list'),
    # path('culture/spots/add/', culture.add_spot, name='add_spot'),
    # path('culture/spots/<int:spot_id>/edit/', culture.edit_spot, name='edit_spot'),

    # 普通用户路由
    # path('user/dashboard/', spot.homepage, name='user_dashboard'),
    # path('user/spots/', user.spot_list, name='spot_list'),
    # path('user/spots/<int:spot_id>/', user.spot_detail, name='spot_detail'),
    # path('user/spots/<int:spot_id>/favorite/', user.toggle_favorite, name='toggle_favorite'),

    # path('admin/list/', admin.admin_list),
    # path('admin/add/', admin.admin_add),
    # path('admin/delete/', admin.admin_delete),
    # path('admin/detail/', admin.admin_detail),
    # path('admin/edit/', admin.admin_edit),
    #
    # path('wenlv/list/', wenlv.wenlv_list),

    path('user/profile/', user.user_profile),
    path('user/edit/profile/', user.edit_user_profile),
    path('user/<int:nid>/edit/profile/', user.edit_user_profile),

    path('login/', login.login, name='login'),
    path('logout/', login.logout),

    path('register/', login.register_view, name='register'),

    path('homepage/', spot.homepage),

    path('travel/article/homepage/', article.travel_article_homepage),
    path('add/<int:nid>/travel/article/', article.add_travel_article),
    path('travel/<int:nid>/article/detail/',article.travel_article_detail,name='travel_article_detail'),

    path('travel/picture/homepage/', picture.travel_picture_homepage),

    path('details/', spot.details),

]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

